const {expect} = require("chai");

describe("contractManager contract", function () {
    let hardhatCM;
    let owner;

    beforeEach(async function () {
        [owner] = await ethers.getSigners();

        const CM = await ethers.getContractFactory("ContractsManager");

        hardhatCM = await CM.deploy();
        await hardhatCM.deployed();

    });

    it("getAddress", function () {

        addr = hardhatCM.addressToString(owner.getAddress());

        expect(addr == owner.getAddress());

    });

    it("addContract", async function () {
        await hardhatCM.addContract("0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0x8219DA2ee542FC07C625700006272039F38a6cE0", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0xe73dD9B3742C259Ff8c88ABaDc90accbAaE26034", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0xdD870fA1b7C4700F2BD7f44238821C26f7392148", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0x583031D1113aD414F02576BD6afaBfb302140225", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");
        await hardhatCM.addContract("0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c", "zhangshan", "abibaibabiiabiaagjdsbjjafdja;sfjkld;asfld;ksjglkd;sjgl;ksdjfl;ksdjfkld;sfjsldkgdksl;fjlsdajf;ksldajgasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss;", "0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa", "ahahahahahahahahahahahaa", "1.1.1");

        await hardhatCM.getAddressAll();
        await hardhatCM.findContract("0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa");

        await hardhatCM.removeContract("0x8a647a5EAC1204fE491d00b35F2951EF11ed76fa");
        await hardhatCM.removeContract("0x8219DA2ee542FC07C625700006272039F38a6cE0");
        await hardhatCM.removeContract("0xe73dD9B3742C259Ff8c88ABaDc90accbAaE26034");
        await hardhatCM.removeContract("0x583031D1113aD414F02576BD6afaBfb302140225");
        await hardhatCM.getAddressAll();


        await hardhatCM.getContractAll();

    });


});

